
$(function () {

    //此处预定义了背景数据，其实可以用ajax获取
    var themes = [
        
        {
            "pic": "https://img.pconline.com.cn/images/photo2/2659873/200512/30/1135933796347.JPG",
            "thumb": "https://img.pconline.com.cn/images/photo2/2659873/200512/30/1135933796347.JPG",
            "title": "河大风景1"
        },
       {
            "pic": "https://tse3-mm.cn.bing.net/th/id/OIP.xvqcYxwCCLydfkaj0XstRQHaEK?pid=Api&rs=1",
            "thumb": "https://tse3-mm.cn.bing.net/th/id/OIP.xvqcYxwCCLydfkaj0XstRQHaEK?pid=Api&rs=1",
            "title": "河大风景2"
        },
        {
            "pic": "https://imgsrc.baidu.com/forum/w%3D580/sign=4b06e01aa61ea8d38a22740ca70830cf/1151564e9258d109cb22fe13d158ccbf6d814d57.jpg",
            "thumb": "https://imgsrc.baidu.com/forum/w%3D580/sign=4b06e01aa61ea8d38a22740ca70830cf/1151564e9258d109cb22fe13d158ccbf6d814d57.jpg",
            "title": "河大风景3"
        },
        {
            "pic": "https://download-p164-drcn.platform.hicloud.com/dl/huafans/pic/2018/06/14/ea9787923c1f7ecbf30a2cda9d454b59_IMG_20180612_163439-02.jpeg?mode=download",
            "thumb": "https://download-p164-drcn.platform.hicloud.com/dl/huafans/pic/2018/06/14/ea9787923c1f7ecbf30a2cda9d454b59_IMG_20180612_163439-02.jpeg?mode=download",
            "title": "明伦大门"
        },
        {
            "pic": "./plugins/theme_switcher/bg/bg15.jpg",
            "thumb": "./bg/bg15_small.jpg",
            "title": "Henu"
        },
        
        
    ];

    var theme_area=$("#theme_area");
    theme_area.on('click','.theme_setting',function () {
        var pic=$(this).data('pic');
        Win10_parent.setBgUrl({main:pic});

        //此处你也许想用ajax把修改信息保存到服务器。。。

    });




    themes.forEach(function (t) {
        var theme=$("<a href=\"javascript:;\" data-pic=\""+t.pic+"\" class=\"theme_setting \">\n" +
            "            <div class=\"theme_icon\"><img src=\""+t.thumb+"\"></div>\n" +
            "            <div class=\"theme_text\">"+t.title+"</div>\n" +
            "        </a>");
        theme_area.append(theme)
    });


});
